<template>
    <view id="posterModuleCopy">
        <view class="copy_val ellipsis_line_com">{{ copyVal }}</view>
        <view class="copy_btn" v-clipboard:copy="copyVal" v-clipboard:success="onCopy">复制</view>
    </view>
</template>
<script>
import Vue from 'vue'
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)
export default {
	name: 'posterModuleCopy',
	components: {},
	data() {
		return {}
	},
	props: {
		copyVal: ''
	},
	mounted() {},
	methods: {
		onCopy(e) {
			let val = e.text
			if (val == '') {
				console.log('551')
				this.$toast('复制失败')
			} else {
				this.$toast('复制成功')
			}
		}
	}
}
</script>

<style lang="scss" scoped>
#posterModuleCopy {
    display: flex;
    align-items: center;
    font-size: 30px;
    color: #333;
    .copy_val {
        width: calc(100% - 130px);
        height: 60px;
        line-height: 60px;
        padding-left: 20px;
        background-color: #fff;
        border-top-left-radius: 50px;
        border-bottom-left-radius: 50px;
    }
    .copy_btn {
        width: 90px;
        height: 60px;
        line-height: 60px;
        color: #3a1b04;
        padding-left: 20px;
        background-color: #fed037;
        border-top-right-radius: 50px;
        border-bottom-right-radius: 50px;
    }
}
</style>
